import { Question, Survey } from '@/api/list';

// 传入survey，生成question id与question对象的映射
export function getHash(survey: Survey) {
  // const map = new Map<string, Question>();
  // survey.questions.forEach((question: Question) => {
  //   map.set(question.id, question);
  // });
}

export function getNextList(node: Question, map: Map<string, Question>) {
  const result: Question[] = [node];
  while (map.get(node.nextId) != null) {
    node = map.get(node.nextId);
    result.push(node);
  }
  return result;
}
